package com.ld.wms.sysenum;

import lombok.Getter;

@Getter
public enum TaskStatusEnum {

    READY(0,"未运行", "#409EFF"),
    RUNNING(1,"运行中", "#33FF33"),
    SUCCESS(2,"已完成", "#8A2BE2"),
    PAUSING(3,"暂停中", "#909399"),
    PAUSED(4,"已暂停", "#909399"),
    STOPPING(5,"停止中", "#F58182"),
    STOP(6,"已停止", "#F58182"),
    DISABLE(7,"禁用", "#909399"),
    SKIP(8,"跳过", "#A9A9A9"),
    ERROR(9,"错误", "#F58182"),
    WARNING(10,"告警", "#1E90FF"),
    ;

    // 枚举内部变量，msg\code.
    private final int status;
    private final String message;
    private final String statusColor;

    TaskStatusEnum(int status, String message, String statusColor) {
        this.status = status;
        this.message = message;
        this.statusColor = statusColor;
    }


    public static  String getColor(int status) {
        for (TaskStatusEnum statusEnum : TaskStatusEnum.values()) {
            if (statusEnum.getStatus() == status) {
                return statusEnum.getStatusColor();
            }
        }
        return "#FFFFFF";
    }

}
